<?php
	ob_start();
	error_reporting(E_ALL);
	ini_set('include_path','.' . PATH_SEPARATOR . dirname(__FILE__));

	require_once 'lib/logger.php';
	require_once 'func.php';
	require_once 'lib/url.php';
	require_once 'lib/request.php';

	require_once 'lib/events.php';
	require_once 'lib/ierror.php';
	require_once 'lib/core.php';

	require_once 'lib/controller.php';
	require_once 'lib/view.php';
	require_once 'lib/filter.php';
	require_once 'lib/html/form.php';

	require_once 'lib/validator.php';
	require_once 'lib/mailer.php';

	require_once 'lib/db/db.php';
	require_once 'lib/db/db_table.php';

	require_once 'lib/file/file.php';
	require_once 'lib/file/image.php';

	require_once 'lib/pager.php';
	require_once 'lib/sorter.php';


	// autoload models
	foreach (glob(_cfg("path")."/_inc/lib/model/*.php") as $model)
		include_once ($model);

	global $app;
	$app = new Core();